﻿using MapHello.Basic;
using MapHello.Service.Live;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace MapHello.Core
{
    class LoginTask : AsyncTask
    {
        public event LoginDelegate OnTaskCompleted;

        public override void Run(object state)
        {
            var loginResult = LiveService.LoginAsync();
            this.Args = new LoginTaskArgs()
            {
                Result = loginResult.Result
            };
        }

        protected override void ProtectedNotifyCompletion()
        {
            if (null != OnTaskCompleted)
            {
                OnTaskCompleted(this.Args as LoginTaskArgs);
            }
        }
    }
}
